import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "main",
    redirect: "/admin/login",
    component: () => import("../components/MainComponent.vue"),
    children: [
      {
        path: "/index",
        name: "index",
        component: () => import("../views/tnt/indexView.vue"),
      },
      {
        path: "/user",
        name: "user",
        component: () => import("../views/tnt/userView.vue"),
      },
      {
        path: "/article",
        name: "article",
        component: () => import("../views/tnt/articleView.vue"),
      },

      {
        path: "/comments",
        name: "comments",
        component: () => import("../views/tnt/commentsView.vue"),
      },
      {
        path: "/feedback",
        name: "feedback",
        component: () => import("../views/tnt/feedbackView.vue"),
      },
      {
        path: "/setting",
        name: "setting",
        component: () => import("../views/tnt/settingsView.vue"),
      },
      {
        path: "/tag",
        name: "tag",
        component: () => import("../views/tnt/tagView.vue"),
      },
    ],
  },
  {
    path: "/admin/login",
    name: "login",
    component: () => import("../views/loginView.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
